package com.cskaoyan.test.day30.work5;

import com.cskaoyan.day30.work5.bean.User;
import org.junit.Test;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Demo {

    @Test
    public void getInfo() throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
        //获取字节码对象
        Class<User> clazz = User.class;

        //获取成员方法
        Method info = clazz.getDeclaredMethod("info", String.class, Integer.class, String.class);

        //调用方法
        Object ret = info.invoke(new User(),"如画", 18, "女");
    }




}
